/**
 * Created with IntelliJ IDEA.
 * User: zhengry
 * Date: 2014/11/18
 * Time: 15:43
 */
define('framework/directive/GillionDirectiveModule', [
    'angular',
    'framework/directive/I18NLoaderConstructor',
    'framework/directive/GillionValidatorConstructor',
    'framework/directive/GillionResourceConstructor',
    'framework/directive/GillionCommonsQueryConstructor',
    'framework/directive/GillionCommonsSaveConstructor',
    'framework/directive/ControlValidatorServiceConstructor',
    'framework/directive/FieldValidatorDirectiveConstructor'
], function (angular, I18NLoaderConstructor, GillionValidatorConstructor, GillionResourceConstructor, GillionCommonsQueryConstructor, GillionCommonsSaveConstructor, ControlValidatorServiceConstructor, FieldValidatorDirectiveConstructor) {
    return angular.module('GillionDirectiveModule', [], ['$compileProvider', '$provide', function ($compileProvider, $provide) {

        $provide.factory('I18NLoader', I18NLoaderConstructor);
        $provide.factory('ControlValidatorService', ControlValidatorServiceConstructor);
        ControlValidatorServiceConstructor.$inject = ['Arrays', '$http', '$timeout'];

        $compileProvider.directive('gValidator', GillionValidatorConstructor);
        GillionValidatorConstructor.$inject = ['$http', '$window', '$compile', 'I18NLoader', 'ControlValidatorService', 'Arrays'];

        $compileProvider.directive('gResource', GillionResourceConstructor);
        GillionResourceConstructor.$inject = ['Resource', 'ResourceService'];

        $compileProvider.directive('gCommonsQuery', GillionCommonsQueryConstructor);

        $compileProvider.directive('gCommonsSave', GillionCommonsSaveConstructor);

        $compileProvider.directive('gFieldValidator', FieldValidatorDirectiveConstructor);
    }]);
});